﻿<%@ Page Language="C#" MasterPageFile="~/Shared/Masters/List.master" AutoEventWireup="true" Theme ="Default"
    CodeFile="RoleList.aspx.cs" Inherits="Modules_System_RoleList" Title="Untitled Page" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="web" TagName="listtitle" Src="~/Shared/UserControls/ListTitle.ascx" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="YYControls" Namespace="YYControls" TagPrefix="yyc" %>
<asp:Content ContentPlaceHolderID="idList" ID="idListContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="crumb">
        <asp:Label runat="server" ID="lblTitle" Text="角色管理"></asp:Label>
    </div>
    <div class="search" id="search">
        <table cellpadding="2" cellspacing="0" class="rtm_shb_b">
            <tr>
                <td style="width: 100px;">
                    <asp:Label runat="server" ID="lblGroupName" Text="名称:"></asp:Label>
                </td>
                <td class="rtm_shb_btn" style="white-space: nowrap">
                    <asp:TextBox runat="server" ID="txtName" Width="200px"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click"></asp:Button>&nbsp;
                    <asp:Button ID="ResetLinkButton" runat="server" Text="重置" OnClientClick="reset();return false;">
                    </asp:Button>
                </td>
            </tr>
        </table>
    </div>
    <div class="toolbar" id="toolbar">
        <h2>
            <web:listtitle ID="Listtitle1" runat="server" Title="角色信息" />
        </h2>
        <asp:LinkButton ID="btnCreate" runat="server" OnClientClick="return openEditor(this, 'add');" OnClick="CreateButton_Click">
            <asp:Label ID="lblCreatNew" runat="server" Text="">
                <img runat="server" id="imgNew" src="../../Images/icon_new.gif" style="border: 0px" />新建</asp:Label>
        </asp:LinkButton>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <contenttemplate>
    <yyc:SmartGridView ID="gvRoleList" runat="server" AutoGenerateColumns="False" AllowSorting="True" OnSorting="gvRoleList_Sorting" OnRowCommand="gvRoleList_RowCommand" OnRowDataBound="gvRoleList_RowDataBound"
        EmptyDataText="没有找到数据!">
        <FixRowColumn FixRowType="Header,Pager" FixColumns="0,1"></FixRowColumn>

        <Columns>
            <asp:TemplateField HeaderText="操作">
                <itemtemplate>
                    <asp:ImageButton runat="server" CommandName="edt" CausesValidation="False" OnClientClick="return openEditor(this, 'read');" ImageUrl="~/Images/icon_edit.gif" ToolTip="查看"  _ID='<%#Eval("Id")%>' ID="ibtnSelect" ></asp:ImageButton>
                    <asp:ImageButton runat="server" CommandName="del" CommandArgument='<%# Eval("ID") %>' CausesValidation="False"  OnClientClick="return sureDelete();" ImageUrl="~/Images/com/dg_del.gif" ToolTip="删除" ID="ibtnDelete" ></asp:ImageButton>
</itemtemplate>
                <controlstyle forecolor="Black" />
                <headerstyle wrap="False" horizontalalign="Center" />
                <itemstyle horizontalalign="Center" forecolor="Black" />
            </asp:TemplateField>
            <asp:BoundField DataField="Code" HeaderText="代码" SortExpression="Code" />
            <asp:BoundField DataField="Name" HeaderText="名称" SortExpression="Name" />
            <asp:BoundField DataField="Purviews" HeaderText="权限" SortExpression="Purviews" />
            <asp:BoundField DataField="Status" HeaderText="状态" SortExpression="Status" />
        </Columns>
        <FixRowColumn FixRowType="Header,Pager" FixColumns="" />
    </yyc:SmartGridView>
    <webdiyer:AspNetPager ID="AspNetPager" CssClass="aspNetPager" ShowBoxThreshold="1" OnPageChanged="AspNetPager_PageChanged"
        runat="server" HorizontalAlign="Right" PageSize="20" AlwaysShow="True" FirstPageText="首页"
        LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" Width="98%" CustomInfoClass="aspNetPager"
        LayoutType="Div" PageIndexBoxType="TextBox" ShowPageIndexBox="Auto">
    </webdiyer:AspNetPager>
     </contenttemplate>
    </asp:UpdatePanel>

    <script type="text/javascript">
        function openEditor(_this, action) {
            var url = "RoleAdd.aspx";
            return default_openEditor(url, _this, action, 750, 450,true);
        } 
        
        function sureDelete()
        {
             return confirm("您确认要删除吗?");        
        }
        
    </script>

</asp:Content>
